package com.demo.common.enums;

import lombok.Getter;

/**
 * 登录Token类型标识枚举类
 *
 * @author Zsx
 * @version 1.0
 * @date 2019-6-11 09:59:04
 */
@Getter
public enum TokenTypeEnum {
    /**
     * 后台登陆Token
     */
    SYS("sys", "后台"),

    /**
     * APP登陆Token
     */
    APP("app", "APP");

    private String value;
    private String name;

    TokenTypeEnum(String value, String name) {
        this.value = value;
        this.name = name;
    }

    public static TokenTypeEnum getEnum(String value) {
        for (TokenTypeEnum item : TokenTypeEnum.values()) {
            if (item.getValue().equals(value)) {
                return item;
            }
        }
        return null;
    }
}
